package com.eshin;

import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.support.GenericApplicationContext;

public class SpringApplicationContextInitializer implements ApplicationContextInitializer<GenericApplicationContext> {

	@Override
	public void initialize(GenericApplicationContext applicationContext) {
		//在这里将XmlWebApplicationContext属性allowBeanDefinitionOverriding设置为false,这个属
		//性的值最终会传递给DefaultListableBeanFactory类的allowBeanDefinitionOverriding属性
		 applicationContext.setAllowBeanDefinitionOverriding(false);
	}

}
